home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbdb
/
definedb.frm
< prev
next >
Wrap
Text File
|
1995-09-06
|
21KB
|
829 lines
VERSION 2.00
Begin Form DefineDatabase
BorderStyle = 3 'Fixed Double
Caption = "Define Database"
ClientHeight = 3930
ClientLeft = 2040
ClientTop = 1905
ClientWidth = 5760
ControlBox = 0 'False
Height = 4335
Left = 1980
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3930
ScaleWidth = 5760
Top = 1560
Width = 5880
Begin CommandButton Command2
Caption = "E&xit"
Height = 372
Left = 1920
TabIndex = 12
Top = 3480
Width = 972
End
Begin CommandButton Command1
Caption = "C&reate Database"
Height = 372
Left = 120
TabIndex = 11
Top = 3480
Width = 1572
End
Begin TextBox Text1
BackColor = &H00C0C0C0&
Enabled = 0 'False
Height = 732
Left = -120
TabIndex = 23
Top = 3360
Width = 6012
End
Begin Frame Fields
Caption = "Fields"
Height = 2292
Left = 4080
TabIndex = 13
Top = 960
Width = 1572
Begin CommandButton Chk_Fld
Caption = "&Validate"
Height = 372
Left = 360
TabIndex = 17
Top = 1800
Width = 852
End
Begin CommandButton Clear_Fld
Caption = "&Clear"
Height = 372
Left = 360
TabIndex = 16
Top = 1320
Width = 852
End
Begin CommandButton Last_Fld
Caption = "&Last"
Height = 372
Left = 360
TabIndex = 15
Top = 840
Width = 852
End
Begin CommandButton Next_Fld
Caption = "&Next"
Height = 372
Left = 360
TabIndex = 14
Top = 360
Width = 852
End
End
Begin Frame Frame1
Caption = "Define Fields"
Height = 2292
Left = 120
TabIndex = 0
Top = 960
Width = 3852
Begin TextBox Fld_Dec
Enabled = 0 'False
Height = 372
Left = 2040
TabIndex = 8
Top = 1680
Width = 612
End
Begin TextBox Fld_Log
Enabled = 0 'False
Height = 372
Left = 1320
TabIndex = 9
Top = 1680
Width = 612
End
Begin TextBox Fld_Len
Height = 372
Left = 2040
TabIndex = 5
Top = 1200
Width = 612
End
Begin TextBox WhichFld
Height = 372
Left = 1320
TabIndex = 19
Text = "1"
Top = 1200
Width = 612
End
Begin ComboBox Fld_Type
Height = 288
Left = 1320
Sorted = -1 'True
TabIndex = 4
Text = "Combo1"
Top = 732
Width = 2292
End
Begin TextBox Fld_Name
Height = 372
Left = 1320
TabIndex = 1
Top = 252
Width = 2292
End
Begin Label Label4
Caption = "&Decimals"
Height = 252
Left = 2760
TabIndex = 7
Top = 1800
Width = 852
End
Begin Label Label5
Alignment = 1 'Right Justify
Caption = "Lo&gical"
Height = 252
Left = 480
TabIndex = 10
Top = 1800
Width = 732
End
Begin Label Label3
Caption = "L&ength"
Height = 252
Left = 2760
TabIndex = 6
Top = 1320
Width = 612
End
Begin Label Label6
Alignment = 1 'Right Justify
Caption = "&Field no."
Height = 252
Left = 360
TabIndex = 18
Top = 1320
Width = 852
End
Begin Label Label2
Alignment = 1 'Right Justify
Caption = "Field &Type"
Height = 252
Left = 240
TabIndex = 3
Top = 768
Width = 972
End
Begin Label Label1
Alignment = 1 'Right Justify
Caption = "Field &Name"
Height = 252
Left = 120
TabIndex = 2
Top = 324
Width = 1092
End
End
Begin Frame Frame2
Caption = "DBF Name"
Height = 732
Left = 120
TabIndex = 20
Top = 120
Width = 5532
Begin TextBox DBF_Name
Height = 372
Left = 2040
TabIndex = 22
Text = "NEW.DBF"
Top = 240
Width = 3012
End
Begin Label Label7
Alignment = 1 'Right Justify
Caption = "Data&base name"
Height = 252
Left = 480
TabIndex = 21
Top = 360
Width = 1452
End
End
End
'Code for Visual Basic 1.0 and Windows 3.0
'(C)1991 Marquis Computing. All Rights Reserved.
'
'Form DefintDatabase
'-------------------
'Gets user input, performs entry validation, verifies structure and builds
'a FldInfo type array that may be used by other VBDB^ routines to create
'a dBASE* III+ compatible database.
'
'^VBDB(C)1991 Marquis Computing, parts (C)1990 Marquis Computing.
' VBDB is a tradmark of Marquis Computing.
'
'*dBASE and dBASE III+ are trademarks of Ashton-Tate.
'
DefInt A-Z
'
'Fld() is an array which carries information to define a database
'header. The constants are used to make using this easier. Fld() is
'defined as follows --
'
'Element #:
'
' 1 = decimal flag (-1 or 0)
' 2 = field length
' 3 = field type (String * 1)
' 4 = field name (String * 12)
' 5 = location of field
'
Const Decimal = 1
Const FLen = 2
Const FType = 3
Const FName = 4
Const OffSet = 5
Dim Fld() As String
Sub Chk_Fld_Click ()
'
'Verifies a flieds data
'
ThisFld = Val(WhichFld.Text)
VerifyData Status, ThisFld
If Not Status Then MsgBox "field definition ok", 64, "Validate Fields"
End Sub
Sub Clear_Fld_Click ()
'
'Clears out a fields data. If the current field is the last field,